<?php declare(strict_types=1);

namespace app\model;

use think\Model;

use think\model\concern\SoftDelete;

class Base extends Model {

    // 软删除
    use SoftDelete;

    protected $connection =  'tp-vue';

    protected $autoWriteTimestamp = 'datetime';
    protected $createTime = 'create_at';
    protected $updateTime = 'update_at';
    protected $deleteTime = 'delete_at';

    public function __construct(array $data = [])
    {
        parent::__construct($data);

        // 未软件删除的数据
        $this->whereNull('delete_at');
    }
}

 
